//*********************************************************
//
//    Copyright (c) Microsoft. All rights reserved.
//    This code is licensed under the Apache License, Version 2.0.
//    THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
//    ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
//    IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
//    PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************

namespace Microsoft.Research.ScientificWorkflow.UIDesigner
{
    using System;
    using SR = Microsoft.Research.DataLayer;

    /// <summary>
    /// Abstraction for job status event notification
    /// </summary>
    public class JobStatusEventArgs : EventArgs
    {
        /// <summary>
        /// Initializes a new instance of the JobStatusEventArgs class
        /// </summary>
        /// <param name="jobName">job Name to be initialized</param>
        /// <param name="jobStatus">status to be initialized</param>
        public JobStatusEventArgs(string jobName, SR.JobStatus jobStatus)
            : base()
        {
            this.Status = jobStatus;
            this.JobName = jobName;
        }

        /// <summary>
        /// Initializes a new instance of the JobStatusEventArgs class
        /// </summary>
        /// <param name="jobStatus">status to be initialized</param>
        /// <param name="jobName">job Name to be initialized</param>
        /// <param name="errorMessage">error message</param>
        public JobStatusEventArgs(string jobName, SR.JobStatus jobStatus, string errorMessage)
            : this(jobName, jobStatus)
        {
            this.ErrorMessage = errorMessage;
            this.JobName = jobName;
        }

        /// <summary>
        /// Gets the current job status
        /// </summary>
        public SR.JobStatus Status { get; private set; }

        /// <summary>
        /// Gets the error message if the job status is aborted
        /// </summary>
        public string ErrorMessage { get; private set; }

        /// <summary>
        /// Gets the job name
        /// </summary>
        public string JobName { get; private set; }
    }
}
